Skip to main content

FileSystem

Members


__index

It is of the type FileSystem.


chdir(self, pathname) → (self, a)

The pathname parameter is a string.

The only return is a string.


copy(self, pathnameFrom, pathnameTo) → self

The parameters for copy are as follows:

  • The pathnameFrom parameter is a string.
  • The pathnameTo parameter is a string. It can also be nil.

It has no return values.


exists(pathname) → a

The pathname parameter is a string.

The only return is a boolean.


filename(pathname) → a

The pathname parameter is a string.

The only return is a string.


join(...) → a

The variadic parameter is a string.

The only return is a string.


mkdir(self, pathname) → self

The pathname parameter is a string. It can also be nil.

It has no return values.


The parameters for mklink are as follows:

  • The linkName parameter is a string.
  • The targetName parameter is a string. It can also be nil.

It has no return values.


moveMerge(self, pathnameFrom, pathnameTo) → self

The parameters for moveMerge are as follows:

  • The pathnameFrom parameter is a string.
  • The pathnameTo parameter is a string. It can also be nil.

It has no return values.


new(source) → a

The source parameter can be any of the following types:

It can also be nil.

The only return is a FileSystem.


parentdir(pathname) → a

The pathname parameter is a string.

The only return is a string.


pwd(self) → (self, a)

It has no parameters.

The only return is a string.


readdir(self, pathname) → (self, a)

The pathname parameter is a string.

The only return is an array of a strings.


readfile(self, filepath) → (self, a)

The filepath parameter is a string.

The only return is a string.


rename(self, pathnameFrom, pathnameTo) → self

The parameters for rename are as follows:

  • The pathnameFrom parameter is a string.
  • The pathnameTo parameter is a string. It can also be nil.

It has no return values.


resolve(pathname) → a

The pathname parameter is a string.

The only return is a string.


separator

It is of the type string.


split(pathname) → a

The pathname parameter is a string.

The only return is an array of a strings.


The pathname parameter is a string.

It has no return values.


writefile(self, filepath, contents) → self

The parameters for writefile are as follows:

  • The filepath parameter is a string.
  • The contents parameter is a string.

It has no return values.

Luau Type

This is the luau type for FileSystem. It may help clear up mistranslations from the raw data to the wiki page (as it is an automatic process).

export type FileSystem = {
split: (pathname: string) -> { string },
copy: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
mkdir: (self: FileSystem, pathname: string?) -> (),
pwd: (self: FileSystem) -> string,
readdir: (self: FileSystem, pathname: string) -> { string },
__index: FileSystem,
new: (source: (FileSystemRoot | FileSystemDirectory)?) -> FileSystem,
separator: string,
resolve: (pathname: string) -> string,
parentdir: (pathname: string) -> string,
join: (...string) -> string,
filename: (pathname: string) -> string,
unlink: (self: FileSystem, pathname: string) -> (),
readfile: (self: FileSystem, filepath: string) -> string,
exists: (pathname: string) -> boolean,
moveMerge: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
mklink: (self: FileSystem, linkName: string, targetName: string?) -> (),
writefile: (self: FileSystem, filepath: string, contents: string) -> (),
rename: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
chdir: (self: FileSystem, pathname: string) -> string,
}